﻿//Search.ascx.cs
////////////////////////////////////////
////////////////////////////////////////
//用户自定义控件，显示搜索控件
////////////////////////////////////////
////////////////////////////////////////
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.Sql;
using System.Data.SqlClient;

public partial class Search : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //////////////////////
        //////////////////////
        //将分类品牌绑定到相应的控件中。
        //////////////////////
        //////////////////////
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        //将需要查询的值通过URL传给Searchinfo.aspx页面。
        String strUrl = "Searchinfo.aspx?";
        /*
        if (this.txtName.Text.Trim() != "") 
        { 
            strUrl += "name=" + Server.HtmlEncode(this.txtName.Text.Trim()) + "&";
        }
        if (this.ddlCategory.Text.Trim() != "")
        { 
            strUrl += "categoryName=" + Server.HtmlEncode(this.ddlCategory.Text.Trim()) + "&"; 
        }
        if (this.ddlBrand.Text.Trim() != "") 
        { 
            strUrl += "brand=" + Server.HtmlEncode(this.ddlBrand.Text.Trim()) + "&"; 
        }
        if (this.ddlAccount.Text.Trim() != "") 
        {
            strUrl += "discount=" + Server.HtmlEncode(this.ddlAccount.Text.Trim()) + "&"; 
        }
        if (this.txtPriceFrom.Text.Trim() != "") 
        {
            strUrl += "PriceFrom=" + Server.HtmlEncode(this.txtPriceFrom.Text.Trim()) + "&";
        }
        if (this.txtPriceTo.Text.Trim() != "") 
        {
            strUrl += "PriceTo=" + Server.HtmlEncode(this.txtPriceTo.Text.Trim()) + "&";
        }
        strUrl = strUrl.Substring(0, strUrl.Length - 1);
         */
        Response.Redirect(strUrl);
    }
}
